home *** CD-ROM | disk | FTP | other *** search
- Path: news.mistral.co.uk!usenet
- From: mikebarnard@mistral.co.uk (Mike Barnard)
- Newsgroups: comp.lang.c
- Subject: Best way to store in program messages?
- Date: Tue, 20 Feb 1996 11:54:10 GMT
- Organization: Mistral Internet (Brighton)
- Message-ID: <4gckb4$77e@news.mistral.co.uk>
- NNTP-Posting-Host: l56.mistral.co.uk
- X-Newsreader: Forte Free Agent 1.0.82
-
- Hi all.
-
- Thanks for your past help.
-
- My last question threw up another in my mind. How do you, the pro's
- out there, store your in-program messages?
-
- So far I havn't written amything of any size at all. I've gotten away
- with having a function to display a title in a box and used...
-
- char title1[]="The program title";
- char title2[]="A copyright message";
-
- ...at the start of that function then cprintf'd the line I wanted.
- Same with the menu I'm working on now, but putting the menuitem
- description in a structure.
-
- But supposing I did a text adventure? Hundreds of messages to store.
- Or a long list of error messages and other inprogram messages giving
- instructions to the user. I'd obviously like them to be stored out of
- harms way, not taking up too much memory, but easily accessable. Would
- you store them in a seperate file #included into the main file? A
- seperate function holding them? It would be nice to have them all in
- one place for ease of editing.
-
- Also I'm not sure what memory is used by char arrays as opposed to
- mallocing (something I havn't touched - yet). I've heard of the heap,
- near and far memory, data and code segments... huh? As an extra
- question can you point me to a good FAQ/Tutorial on heaps, near and
- far etc?
-
- OK. That's enough wibbling. I'm using a PC with borland c++3.0. and so
- far my programs are all in text mode. And will be for quite a while!
- :-)
-
- Thanks again.
-
- ---
- Mic.
- From very windy and now snowy Worthing; England.
- mikebarnard@mistral.co.uk
-
- (I just lost 4 fence panels to the wind here! The cost of
- replacing them could have bought me a new windows compiler!)
-
-